package com.example.mybiadushoujiweishi.activity.acivitys.fragments;

import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;


import com.example.mybiadushoujiweishi.R;
import com.example.mybiadushoujiweishi.activity.acivitys.adapter.AddContactsAdapter;
import com.example.mybiadushoujiweishi.activity.acivitys.entity.Contact;
import com.example.mybiadushoujiweishi.activity.acivitys.utils.MyApplication;


import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.Unbinder;

/**
 * Created by Administrator on 2017/6/5 0005.
 */

public class ShowallContactsFragment extends Fragmentbase {
    List<Contact> list;
    AddContactsAdapter addContactsAdapter;
    @BindView(R.id.help_serch)
    RecyclerView helpSerch;
    Unbinder unbinder;

    @Override
    public int getXml() {
        return R.layout.show_all_contact_fragment;
    }

    @Override
    public void initView() {

    }

    @Override
    public void initData() {
        list = MyApplication.getList();
        System.out.println(list.size() + "}}}}}}}}}}}}}}}}}}");
        LinearLayoutManager linearLayoutManager=new LinearLayoutManager(getActivity());
        helpSerch.setLayoutManager(linearLayoutManager);
        TextView textView= (TextView) getActivity().findViewById(R.id.chosecontactnumber);
        addContactsAdapter=new AddContactsAdapter(list,textView);
        helpSerch.setAdapter(addContactsAdapter);

    }



    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // TODO: inflate a fragment view
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        unbinder = ButterKnife.bind(this, rootView);
        return rootView;
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }


}
